package com.ai.tikai.controller;

import com.ai.tikai.service.impl.MessageProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MessageController {
    @Autowired
    private MessageProducer messageProducer;

    @GetMapping("/send")
    public String sendMessage(@RequestParam("msg") String msg) {
        messageProducer.sendMessage(msg);
        return "消息 '" + msg + "' 已成功发送！";
    }
}
